class Psysource::HomePageController < ApplicationController

  #layout "/psysource/home_page"

  def index
    @news=New.find(:all,:order => "created_at DESC")
  end 
  
  def contact
  end
  
  def solution
  
  end
  #新闻中心
  def news
     @new=New.find(params[:id])
     render :layout => false
  end
  def news_center
    @news=New.paginate :per_page => 13, :page=>params[:page] ,:order => "created_at DESC"
  end
  #研究中心
  def research
   @research=Research.find(params[:id])
  end
  
  def research_center
    @researches=Research.find(:all)
  end
  
  def faquestion
   @faquestion=Faquestion.find(params[:id])
  end
  
  def faquestions
    @faquestions=Faquestion.find(:all)
  end
  
  def create_image
         @image = Image.new(params[:image])
         @image.new_id=params[:c_id]
         @image.filename=params[:c_id]+"_news"+@image.filename
         if @image.save
             flash[:notice] = 'Image was successfully created.'
             redirect_to(:action=>"index" )
         else
             redirect_to(:action=>"index" )
         end 
     end


  def news_feed
    @news = New.find(:all, :limit => 10, :order => "created_at DESC")
    render :template => "/psysource/home_page/news_feed.rss.builder", :layout => false
  end
end




